package picounit.loader;

public class ImplementationLoader {
    public ImplementationLoader(String resourceName) {
        this.properties = new Properties(resourceName);
    }

    public <B> B load(Class<B> apiClass) {
        return apiClass.cast(instantiator.instantiate(properties.get(apiClass.getName())));
    }

    private final Properties properties;
    private final Instantiator instantiator = new Instantiator();
}